<?php
    // No direct access.
    defined('_JEXEC') or die;

    JHtml::_('behavior.framework', true);
    // get params
    $app = JFactory::getApplication();
    $doc = JFactory::getDocument();

    $itemid = JRequest::getVar('Itemid','','get','int');
    $class_current = 'class="current"';
    $lang =& JFactory::getLanguage();
    $langdefault = $lang->getTag();
    $Itemid = JRequest::getInt('Itemid')?JRequest::getInt('Itemid'):JRequest::getInt('Itemid');
    require_once(JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
    require_once(JPATH_SITE.DS.'components'.DS.'com_contact'.DS.'helpers'.DS.'route.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.:: Thép Uy Long ::.</title>
        <link rel="shortcut icon" href="<?php echo $this->baseurl ?>/templates/fullhouse/favicon.ico" />
        <link href="<?php echo $this->baseurl ?>/css/Styles.css" rel="stylesheet" type="text/css">
        <script type="text/javascript">var site_url = '<?php  echo JURI::base( true ); ?>';</script>
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/js/jquery-1.4.2.min.js"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/css/SlideShow.css">
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/js/SlideShow.js"></script>
         <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>   
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseurl ?>/js/droplinebar.css" />
        <script src="<?php echo $this->baseurl ?>/js/droplinemenu.js" type="text/javascript"></script>

        <script type="text/javascript">

            //build menu with DIV ID="myslidemenu" on page:
            droplinemenu.buildmenu("mydroplinemenu");
        </script>

    </head>
    <body>
        <div id="swapper">
        <div class="header">
        <jdoc:include type="modules" name="language" />
        <div id="logo"> <img src="<?php echo $this->baseurl ?>/images/Logo_vn.jpg" id="ctl00_imgBanner"> </div>
        <div id="company_name"><?php echo JText::_('COMPANYTITLE');?></div>
        <div id="dolphincontainer">      
            <div id="mydroplinemenu" class="droplinebar">
                <ul>
                    <li><a  <?php if($Itemid==435) echo 'class="menuhover"'; else echo '';?> href="index.php"><span class="iconic"></span><?php echo JText::_('HOME') ?> </a></li>   
                    <li><a <?php if($Itemid==506) echo 'class="menuhover"'; else echo '';?> href="<?php echo JRoute::_('index.php?option=com_content&view=category&layout=blog&id=87&Itemid=506') ?> "><?php echo JText::_('INTRO'); ?></a>
                        <ul>
                            <?php 
                                $db = JFactory::getDbo();
                                $sql = "Select * from #__content where catid = 87 and state=1 and language = '$langdefault' order by ordering ASC";
                                $db->setQuery($sql);
                                $db->query();
                                $result = $db->loadObjectList(); 

                                foreach($result as $obj){
                                    $item->slug = $obj->alias ? ($obj->id.':'.$obj->alias) : $obj->id;
                                    $item->catslug = $obj->category_alias ? ($obj->catid.':'.$obj->category_alias) : $obj->catid;          
                                ?>
                                <li><a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catslug))?>"><?php echo $obj->title;?></a></li>
                                <?php }?>
                            <!--<li><a href="#">Activities 3</a>
                            <ul>
                            <li><a href="#">Water Sports 1</a></li>
                            <li><a href="#">Water Sports 1</a></li>
                            <li><a href="#">Water Sports 1</a></li>
                            <li><a href="#">Water Sports 1</a></li>
                            </ul>
                            </li>
                            <li><a href="#">Activities 4</a></li>-->
                        </ul>
                    </li>
                    <li><a  <?php if($Itemid==507) echo 'class="menuhover"'; else echo '';?> href="<?php echo JRoute::_('index.php?option=com_content&view=categories&id=78&Itemid=507'); ?> "> <?php echo JText::_('PRODUCT'); ?> </a>
                        <ul>
                            <?php 
                                $db = JFactory::getDbo();
                                $sql = "Select * from #__categories where parent_id = 78 and published=1 order by id asc";
                                $db->setQuery($sql);
                                $db->query();
                                $result = $db->loadObjectList();
                                foreach($result as $obj){
                                    $item->slug = $obj->alias ? ($obj->id.':'.$obj->alias) : $obj->id;         
                                ?>
                                <li><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->slug))?>"><?php echo $obj->title;?></a>
                                 <?php
                                $sql_item = "SELECT * FROM #__content where catid = '" . $obj->id . "' and state = 1 order by id DESC";
                                $db->setQuery($sql_item);
                                $db->query();     
                                $result_item = $db->loadObjectList();
                                if($result_item){
                                    echo '<ul>';                                    
                                foreach($result_item as $obj_item)
                                {                  
                                $link = JRoute::_(ContentHelperRoute::getArticleRoute($obj_item->id,$obj_item->catid));              
                                echo '<li><a href="'.$link.'">'.$obj_item->title.'</a></li>';
                                }
                                echo '</ul>';
                                } ?>
                                </li>
                                <?php }?>
                        </ul>

                    </li>
                    <!--<li><a href="http://www.javascriptkit.com/">JavaScript</a>
                    <ul>
                    <li><a href="#">Traveling 1</a></li>
                    <li><a href="#">Traveling 2</a></li>
                    <li><a href="#">Traveling 3</a></li>
                    <li><a href="#">Traveling 4</a>
                    <ul>
                    <li><a href="#">Africa 1</a></li>
                    <li><a href="#">Africa 2</a></li>
                    <li><a href="#">Africa 3</a></li>
                    <li><a href="#">Africa 4</a>
                    <ul>
                    <li><a href="#">Kenya 1</a></li>
                    <li><a href="#">Kenya 2</a></li>
                    <li><a href="#">Kenya 3</a></li>
                    <li><a href="#">Kenya 4</a></li>
                    <li><a href="#">Kenya 5</a></li>
                    </ul>
                    </li>
                    </ul>
                    </li>
                    <li><a href="#">Traveling 5</a></li>
                    </ul>
                    </li>-->
                    <li><a <?php if($Itemid==508) echo 'class="menuhover"'; else echo '';?>  href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=84&Itemid=508');?>"><span class="iconic"></span> <?php echo JText::_('BRANCH') ?> </a></li>

                    <li><a <?php if($Itemid==510) echo 'class="menuhover"'; else echo '';?>  href="<?php echo JRoute::_('index.php?option=com_content&view=article&id=85&Itemid=510');?>"><span class="iconic"></span> <?php echo JText::_('PROJECT') ?> </a></li>

                    <li><a <?php if($Itemid==505) echo 'class="menuhover"'; else echo '';?>  href="index.php?option=com_contact&view=contact&id=1&Itemid=505"><span class="iconic"></span> <?php echo JText::_('CONTACT'); ?> </a></li>
                </ul>
            </div>

            <div class="timkiem">
                <!--                <input type="text" onblur="ClearSpecialWord(this);" onkeyup="ClearSpecialWord(this);" onkeypress="KeypressSearch(this,event);" id="txtSearchKey" name="txtSearchKey">
                <input type="button" onclick="ClickSearch('txtSearchKey');" class="button" id="btnSearch" name="btnSearch">-->
                <jdoc:include type="modules" name="position-0" />
            </div>
            <div class="content">
                <?php if($Itemid!=435) :?> 
                    <jdoc:include type="modules" name="position-2" />
                    <?php  endif;?> 
                <jdoc:include type="message" />
                <jdoc:include type="component" />
                <?php
                    if($Itemid==507){
                ?>
                <jdoc:include type="modules" name="product_cat" /> 
                <?php
                    }
                ?>

            </div>
            <div class="footer">
                <div class="dc">
                    <?php 
                        $db = JFactory::getDbo();
                        $query = "select * from #__content where id = 72 and state=1";
                        $db->setQuery($query);
                        $db->query();
                        $result = $db->loadObject();
                        echo $result->introtext;
                    ?>
                </div>
                <div class="copy"><?php echo JText::_('COPYRIGHT');?><br /><br />
                <?php echo JText::_('DESIGN');?> <a href="http://www.webhitek.com/" target="_blank">Webhitek</a> </div>
            </div>
        </div>
    </body>
</html>